// AWTCheckbox.h: interface for the AWTCheckbox class.
//
//////////////////////////////////////////////////////////////////////

#if !defined(AFX_AWTCHECKBOX_H__B9BB53A5_46F7_11D2_A6A1_0004AC24604E__INCLUDED_)
#define AFX_AWTCHECKBOX_H__B9BB53A5_46F7_11D2_A6A1_0004AC24604E__INCLUDED_

#if _MSC_VER >= 1000
#pragma once
#endif // _MSC_VER >= 1000

#include "AWTComponent.h"

class AWTCheckboxGroup;

class AFX_EXT_CLASS AWTCheckbox : public AWTComponent,
                                  public AWTItemSelectable  
{
DECLARE_DYNAMIC(AWTCheckbox)
public:
	AWTCheckbox();
	AWTCheckbox(LPTSTR label);
	AWTCheckbox(CString& label);
	AWTCheckbox(LPTSTR label, BOOL state);
	AWTCheckbox(CString& label, BOOL state);
	AWTCheckbox(LPTSTR label, BOOL state, AWTCheckboxGroup* group);
	AWTCheckbox(CString& label, BOOL state, AWTCheckboxGroup* group);
	AWTCheckbox(LPTSTR label, AWTCheckboxGroup* group, BOOL state);
	AWTCheckbox(CString& label, AWTCheckboxGroup* group, BOOL state);

	virtual ~AWTCheckbox();

	void construct(CString& label, BOOL state, AWTCheckboxGroup* group);

  CString& getLabel() 
		{return m_label;}
	void setLabel(LPTSTR s)
		{setLabel(CString(s));}
	void setLabel(CString& s)
		{m_label = s;}
	BOOL getState()
		{return m_state;}
	void setState(BOOL state);
	CStringArray* getSelectedObjects();
  AWTCheckboxGroup* getCheckboxGroup() 
		{return m_group;}
	void setCheckboxGroup(AWTCheckboxGroup* g);
	void addItemListener(AWTItemListener* l);
	void removeItemListener(AWTItemListener* l);
	void setStateInternal(BOOL state);
	void processItemEvent(AWTItemEvent* e);
	AWTObject* getObject()
		{return this;}
	CSize getMinimumSize();
	CSize getPreferredSize();
	virtual BOOL isFocusTraversable()
		{return TRUE;}

protected:
	CWnd* createComponent();

	CString m_label;
	BOOL m_state;
	AWTCheckboxGroup* m_group;
	AWTItemListener* itemListener;
};

#endif // !defined(AFX_AWTCHECKBOX_H__B9BB53A5_46F7_11D2_A6A1_0004AC24604E__INCLUDED_)
